package com.example.contestsystem.Dao;

import com.example.contestsystem.Entity.FileEntity;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import java.util.List;

public interface ContestFileRepository extends JpaRepository<FileEntity, String> {

    List<FileEntity> findByContestId(String contestId);

    FileEntity findByContestIdAndFileId(String contestId, String fileId);

    @Modifying
    @Transactional
    void deleteByContestId(String contestId);
}
